package com.muyu.cloud.commodity.domain.resp;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.cloud.commodity.info.SpecGroupInfo;
import lombok.Builder;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 商品详情响应
 *
 * @author <a href="mailto:602048165@qq.com">60204</a>
 * @version 1.0
 * @description: 商品详情响应
 * @date 2025/9/16 10:00
 */
@Data
@Builder
public class ProductDetailResp {
    private Long id;
    private String productName;
    private String productPic;
    private String description;
    private BigDecimal marketPrice;
    private Long categoryId;
    private Long brandId;
    private Integer viewCount;
    private Integer collectCount;
    private Integer status;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date createdAt;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date updatedAt;

    // 关联数据
    private String categoryName;
    private String brandName;
    private List<ProductSkuDetailResp> skuList;

    // 评价统计
    private BigDecimal avgScore;
    private Integer commentCount;

    // 规格组信息（用于前端展示规格选择）
    private List<SpecGroupInfo> specGroups;
}
